<?php
/* Smarty version 3.1.33, created on 2019-12-22 19:00:48
  from 'D:\xampp\htdocs\ps_project\application\views\templates\diner\shop\index.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33',
  'unifunc' => 'content_5dffaf50691a25_70136838',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'e84c551e87eb5fa2cfceaa764132f6d913125089' => 
    array (
      0 => 'D:\\xampp\\htdocs\\ps_project\\application\\views\\templates\\diner\\shop\\index.tpl',
      1 => 1577037643,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5dffaf50691a25_70136838 (Smarty_Internal_Template $_smarty_tpl) {
?><div class="merchant-wrapper">
	<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['dishes']->value, 'dish');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['dish']->value) {
?>
	<div class="food-info-list" id="dish<?php echo $_smarty_tpl->tpl_vars['dish']->value['id'];?>
">
		<div class="food-introduce">
			<img class="food-introduce-pic" src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/merchant/upload/<?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
/dish/<?php echo $_smarty_tpl->tpl_vars['dish']->value['id'];?>
.png" alt="chicken"
				 onerror="this.src='<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/merchant/upload/default.png';this.onerror=null">
			<div class="food-introduce-info">
				<h3 class="food-introduce-name"><?php echo $_smarty_tpl->tpl_vars['dish']->value['dname'];?>
</h3>
				<p class="food-introduce-discount">限时<?php echo $_smarty_tpl->tpl_vars['dish']->value['discount']*10;?>
折，快来抢购</p>
				<p class="food-introduce-money">原价￥<?php echo $_smarty_tpl->tpl_vars['dish']->value['price'];?>
</p>
				<div class="food-introduce-cart">
					<button class="food-introduce-addcart" onclick="dish_add(<?php echo $_smarty_tpl->tpl_vars['dish']->value['id'];?>
, <?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
)">加入购物车</button>
					<form class="food-introduce-form">
						<input type="hidden">
						<button class="add-food" type="button" onclick="dish_min(<?php echo $_smarty_tpl->tpl_vars['dish']->value['id'];?>
, <?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
)">-</button>
						<input class="food-number" oninput="dish_change(<?php echo $_smarty_tpl->tpl_vars['dish']->value['id'];?>
, <?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
, this.value)">
						<button class="minus-food" type="button" onclick="dish_add(<?php echo $_smarty_tpl->tpl_vars['dish']->value['id'];?>
, <?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
)">+</button>
					</form>
				</div>
			</div>
		</div>
	</div>
	<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>


<div>
	<div class="cart">
		<div class="cart-header">
			<div class="cart-header-content">
				<div style="color: #333333; font-size: 14px">
					购物车<span id="emptyCart" style="cursor: pointer" onclick="cleanCart(<?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
)">[清空]</span>
				</div>
				<div>
					<img src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/diner/assets/images/cart.svg" style="width: 30px;">
				</div>
			</div>
		</div>

		<div id="cart_basket"></div>

		<div class="wrapper">
			<div class="cart-info">
				<span class="cart-icon">
					<img src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/diner/assets/open-iconic/svg/cart.svg">
				</span>
			</div>
			<a href="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
diner/order/<?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
" style="text-decoration:none">
				<div class="cart-status" >
					<p class="status-info">购物车是空的</p>
				</div>
			</a>
		</div>
	</div>

</div>
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/diner/js/cart.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/js/jquery.min.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/js/popper.min.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
 src="<?php echo $_smarty_tpl->tpl_vars['base_url']->value['base_url'];?>
application/views/templates/js/bootstrap.min.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
>
	window.onload = function (){
		let order = JSON.parse(`<?php echo $_smarty_tpl->tpl_vars['order_info']->value;?>
`);
		loadCartFromSession(order, <?php echo $_smarty_tpl->tpl_vars['mid']->value;?>
);
	};
<?php echo '</script'; ?>
>
</body>

</html>
<?php }
}
